package com.px.chapter_Nov_1;

public class text8 {
    public static void main(String[] args) {
        int temp[][] = new int[4][4];
        int a = 2;
        int b = 1;
        temp[a][b] = 1;//中间
        temp[a + 1][b] = 1;//下
        temp[a][b + 1] = 1;//右
       // temp[a - 1][b] = 1;//上

        temp[a][b-1]=1;//左
         ArraryMath.outArrary(temp);
        if (temp[a][b + 1] == 1 && temp[a + 1][b] ==1 && temp[a - 1][b] == 1) {
            temp[a][b - 1] = 1;
            temp[a - 1][b] = 0;
        }//右下上
        if (temp[a][b-1]==1 && temp[a + 1][b] == 1 && temp[a][b + 1] == 1) {
            temp[a - 1][b] = 1;
            temp[a][b + 1] = 0;
        }//左下右
        if (temp[a][b-1]==1 && temp[a - 1][b] == 1 && temp[a][b + 1] == 1) {
            temp[a][b + 1] = 1;
            temp[a + 1][b] = 0;
        }//左上上
        if (temp[a - 1][b] == 1 && temp[a][b-1]==1 && temp[a][b + 1] == 1) {
            temp[a + 1][b] = 1;
            temp[a][b-1]= 0;
        }
        ArraryMath.outArrary(temp);
        for (int ii=1;ii<=100;ii++){
           // if (tips.isPriem(ii)){
                System.out.print(ii+"\t");
            }
        }
       // System.out.println(2%5);
        int aa=17,bb;

           // bb=rabbit(10)+2rab;
       // System.out.println(bb);

        /*  for (int i = 0; i < temp.length; i++) {
            for (int j = i+1; j < temp[i].length; j++) {
                int k = temp[i][j];
                temp[i][j] = temp[j][i];
                temp[j][i] = k;
            }
        }
        System.out.println("==========");
        ArraryMath.outArrary(temp);*/

        /*   int c[][] = new int[5][5];
        for (int a = 0; a < c.length; a++) {
            c[a][a] = 1;
            c[a][0] = 1;
        }
        ArraryMath.outArrary(c);
        for (int a = 2; a < c[0].length; a++) {
            for (int dd = 0; dd < c.length; dd++) {
               if (c[a][dd+1]==0){
                   System.out.println("dd");
                   c[a][dd+1]=c[a-1][dd]+c[a-1][dd+1];
                } else if (c[a][a]==1){
                   break;
               }
            }
        }
        for (int a=0;a<c.length;a++){
            for (int bb=0;bb<c[a].length;bb++){
               if (c[a][bb]!=0){
                   System.out.print(c[a][bb]+"  ");
               }
            }
            System.out.println();
        }
        */



        /*
        int[] a=new int[10];
        ArraryMath.inArraryRandom(a,50);
        for(int i=0;i<a.length-1;i++){
            for (int y=0;y<a.length-1;y++){
                if (a[y]<a[y+1]){
                    int aa=a[y+1];
                    a[y+1]=a[y];
                    a[y]=aa;
                }
            }
        }
        ArraryMath.outArrary(a);

*/

        /*
        Scanner scanner=new Scanner(System.in);
        int c=scanner.nextInt();
        int a[]=new int[10];
        ArraryMath.inArraryRandom(a,10);
        for (int b= 0;b<a.length-1;b++){
            if (a[b]==c){
                System.out.println("有相等数");
                break;
            }
        }
*/

      /*  int a[]=new int[10];
        ArraryMath.inArraryRandom(a,10);
        int b=0;
        for (int c=0;c<a.length-1;c++){
            b=b+a[c];
        }
        ArraryMath.outArrary(a);
        System.out.println("\n"+b/a.length);
*/
        /*
        int[] a=new int[10];
        int[] b=new int[10];
        int aa=a.length-1,bb=0;
        ArraryMath.inArraryRandom(a,10);
        ArraryMath.outArrary(a);
        for (;aa>=0;aa--){
            b[bb] = a[aa];
            bb++;
        }
        System.out.println("\n");
        ArraryMath.outArrary(b);


*/

    }
   /* public static int rabbit(int a){
     int n=0;
        for (int i=0;i<=a;i++){
         if (i<3){
             n=1;
         }else {
             n++;
         }
     }
     return n;
    }*/


